<?php 	
	function cekGambar($id, $tipeKontak, $jenisGambar){
      switch ($tipeKontak) {
        case 1:
          $folder = "img/";
          break;

        case 2:
          $folder = "img/group/";
          break;
      }
      switch ($jenisGambar) {
        case 1:
          $image = "resize_";
          break;

        case 2:
          $image = "thumb_";
          break;

        case 3:
          $image = "ico_";
          break;
      }
      $imgFull = $folder.$image.$id.".jpg";
      $imgDefault = $folder.$image."default.jpg";
      if (file_exists($imgFull)) {
        $imageURL = $imgFull."?".time();
      } else {
        $imageURL = $imgDefault."?".time();
      }
      return $imageURL;
	}
?>
